﻿<%@ Register TagPrefix="ucCommon" TagName="Common" Src="../Common/Inc/Common.ascx" %>
<%@ Register TagPrefix="ucTop" TagName="Top" Src="../Common/Inc/Top.ascx" %>
<%@ Register TagPrefix="ucMenu" TagName="Menu" Src="../Common/Inc/Menu.ascx" %>
<%@ Register TagPrefix="ucTabTitle" TagName="TabTitle" Src="../Common/Inc/TabTitle.ascx" %>
<%@ Register TagPrefix="ucCopyright" TagName="Copyright" Src="../Common/Inc/Copyright.ascx" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Crd2011r.aspx.cs" Inherits="Updms.Crd.Crd2011r" %>
<%@ Register Assembly="ChartFX.WebForms" Namespace="ChartFX.WebForms" TagPrefix="chartfx7" %>
<%@ Register Assembly="ChartFX.WebForms.Adornments" Namespace="ChartFX.WebForms.Adornments"	TagPrefix="chartfxadornments" %>
<%@ Register Assembly="ChartFX.WebForms" Namespace="ChartFX.WebForms.Galleries" TagPrefix="chartfx7galleries" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>▒ UPDMS [Crd2011r] ▒▒▒▒▒▒▒▒▒▒</title>
<ucCommon:Common id="Common" runat="server"></ucCommon:Common>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager runat="server" id="ScriptManager1" EnableScriptGlobalization="true"></asp:ScriptManager>

<table id="table_frame">
	<tr>
		<td id="top_area" colspan="2">
			<!-- Top 시작 -->
			<ucTop:Top id="Top" runat="server"></ucTop:Top>
			<!-- Top 끝 -->	
		</td>
	</tr>
	<tr>
		<td id="menu_area">
			<!-- 메뉴 시작 -->
			<ucMenu:Menu id="Menu" runat="server"></ucMenu:Menu>
			<!-- 메뉴 끝 -->	
		</td>
		<td id="contents_area">
			<!-- 제목 시작 -->
			<ucTabTitle:TabTitle id="TabTitle" TagPrefixs="Crd2011r" runat="server"></ucTabTitle:TabTitle>
			<!-- 제목 끝 -->
			<!-- AJAX 시작 -->
			<asp:UpdatePanel ID="UpdatePanel1" runat="server">
			<ContentTemplate>
			<!-- 버튼 시작 -->
			<div class="button_area">
				<asp:linkbutton id="ibtn_chart" Text="챠트" runat="server" CssClass="ibtn ibtn_chart" OnClick="ibtn_chart_Click" OnClientClick="return chkSearch()"></asp:linkbutton>
			</div>
			<!-- 버튼 끝 -->
			<!-- 검색 시작 -->
			<table class="table_search">
				<tr>
					<td class="lbl" width="11%"><asp:Literal id="ltr_search_card_cd" Text="카드" runat="server" /></td>
					<td class="ctl" width="22%"><asp:dropdownlist id="ddl_search_card_cd" runat="server" CssClass="ddl"></asp:dropdownlist></td>
					<td class="lbl" width="11%"><asp:Literal id="ltr_search_region" Text="검색기간" runat="server" /></td>
					<td class="ctl" width="29%">
						<ul class="horizontal">
							<li><asp:dropdownlist id="ddl_search_from_year" runat="server"></asp:dropdownlist><asp:dropdownlist id="ddl_search_from_month" runat="server">
										<asp:ListItem Value="01">01</asp:ListItem>
										<asp:ListItem Value="02">02</asp:ListItem>
										<asp:ListItem Value="03">03</asp:ListItem>
										<asp:ListItem Value="04">04</asp:ListItem>
										<asp:ListItem Value="05">05</asp:ListItem>
										<asp:ListItem Value="06">06</asp:ListItem>
										<asp:ListItem Value="07">07</asp:ListItem>
										<asp:ListItem Value="08">08</asp:ListItem>
										<asp:ListItem Value="09">09</asp:ListItem>
										<asp:ListItem Value="10">10</asp:ListItem>
										<asp:ListItem Value="11">11</asp:ListItem>
										<asp:ListItem Value="12">12</asp:ListItem>
									</asp:dropdownlist></li>
							<li>&nbsp;~&nbsp;</li>
							<li><asp:dropdownlist id="ddl_search_to_year" runat="server"></asp:dropdownlist><asp:dropdownlist id="ddl_search_to_month" runat="server">
										<asp:ListItem Value="01">01</asp:ListItem>
										<asp:ListItem Value="02">02</asp:ListItem>
										<asp:ListItem Value="03">03</asp:ListItem>
										<asp:ListItem Value="04">04</asp:ListItem>
										<asp:ListItem Value="05">05</asp:ListItem>
										<asp:ListItem Value="06">06</asp:ListItem>
										<asp:ListItem Value="07">07</asp:ListItem>
										<asp:ListItem Value="08">08</asp:ListItem>
										<asp:ListItem Value="09">09</asp:ListItem>
										<asp:ListItem Value="10">10</asp:ListItem>
										<asp:ListItem Value="11">11</asp:ListItem>
										<asp:ListItem Value="12">12</asp:ListItem>
									</asp:dropdownlist></li>
							<li><asp:linkbutton id="sbtn_6_m" runat="server" ToolTip="6개월" OnClick="sbtn_6_m_Click"><img src="../Common/Images/calendar_6m.gif" align="top"></asp:linkbutton><asp:linkbutton id="sbtn_12_m" runat="server" ToolTip="12개월" OnClick="sbtn_12_m_Click"><img src="../Common/Images/calendar_12m.gif" align="top"></asp:linkbutton><asp:linkbutton id="sbtn_all_m" runat="server" ToolTip="전체" OnClick="sbtn_all_m_Click"><img src="../Common/Images/calendar_all.gif" align="top"></asp:linkbutton></li>
						</ul>
					</td>
					<td class="lbl" width="11%" title="본사지원, 기타(통계미반영)"><asp:Literal id="ltr_support_yn" Text="미반영제외" runat="server" /></td>
					<td class="ctl" width="15%"><asp:checkbox id="cb_support_yn" runat="server"></asp:checkbox></td>
				</tr>
			</table>
			<!-- 검색 끝 -->
			<!-- 디테일 시작 -->
			<table id="table_detail" cellpadding="0" cellspacing="0" border="0" width="100%" runat="server">
				<tr>
					<td width="59%" valign="top">
						<!-- 바챠트 시작 -->
						<table id="table_chart_line_total" class="default" runat="server">
							<tr>
								<td><div class="sub_title_icon"><asp:Literal id="ltr_stitle_card_using_chart" Text="카드사용챠트" runat="server" /></div></td>
							</tr>
							<tr>
								<td class="td_box">
									<chartfx7:Chart ID="chart_line_total" runat="server" Height="460px" Palette="DarkPastels.Pastels" Width="600px" ImageSettings-Interactive="False">
										<AxisY Title-Text="금액 (원)">
											<Grids Major-Style="Dash" Interlaced="True"></Grids>
											<LabelsFormat CustomFormat="###,###,##0" />
										</AxisY>

										<AxisX Title-Text="">
										<Grids Major-Visible="False"></Grids>
										</AxisX>

										<AllSeries Gallery="Bar" BarShape="Cylinder"></AllSeries>

										<LegendBox Dock="Top"></LegendBox>

										<MainPane AxisY-Title-Text="금액 (원)"></MainPane>
										<SpecialObjects>
											<chartfxadornments:SimpleBorder AssemblyName="ChartFX.WebForms.Adornments" Color="Transparent"
												Type="None">
											</chartfxadornments:SimpleBorder>
											<chartfxadornments:GradientBackground AssemblyName="ChartFX.WebForms.Adornments"
												ColorFrom="Transparent" EffectArea="0">
											</chartfxadornments:GradientBackground>
											<chartfx7galleries:Bar Overlap="True">
											</chartfx7galleries:Bar>
										</SpecialObjects>										
										<Series>
											<chartfx7:SeriesAttributes Stacked="True" Text="일시불" />
											<chartfx7:SeriesAttributes Stacked="True" Text="현금서비스" />
											<chartfx7:SeriesAttributes Stacked="True" Text="할부" />
										</Series>
									</chartfx7:Chart>
								</td>
							</tr>
						</table>
						<!-- 바챠트 끝 -->
						<br>
						<!-- 전체리스트 시작 -->
						<!-- 검색어 시작 -->
						<table id="table_dg1" cellpadding="0" cellspacing="0" border="0" width="100%" runat="server">
							<tr>
								<td class="sub_title_icon"><asp:label id="lbl_search_keyword" runat="server"></asp:label></td>
							</tr>
							<tr>
								<td>
									<asp:GridView ID="GridView1" CssClass="table_gridview" GridLines="None" runat="server" AutoGenerateColumns="False" OnRowDataBound="GridView1_RowDataBound" ShowFooter="True">
										<Columns>
											<asp:BoundField HeaderText="번호" HtmlEncode="False" >
												<ItemStyle HorizontalAlign="Center" Width="6%" />
											</asp:BoundField>
											<asp:BoundField DataField="Paymnt_Dt" HeaderText="결제일" HtmlEncode="False" >
												<ItemStyle HorizontalAlign="Center" Width="14%" />
											</asp:BoundField>
											<asp:BoundField DataField="Total_All" HeaderText="총액" HtmlEncode="False" DataFormatString="{0:#,##0}" >
												<ItemStyle HorizontalAlign="Right" Width="18%" />
											</asp:BoundField>
											<asp:BoundField DataField="Total_Mass" HeaderText="일시불" HtmlEncode="False" DataFormatString="{0:#,##0}" >
												<ItemStyle HorizontalAlign="Right" Width="14%" />
											</asp:BoundField>
											<asp:BoundField DataField="Total_Cash" HeaderText="현금서비스" HtmlEncode="False" DataFormatString="{0:#,##0}" >
												<ItemStyle HorizontalAlign="Right" Width="14%" />
											</asp:BoundField>
											<asp:BoundField DataField="Total_Ins" HeaderText="할부" HtmlEncode="False" DataFormatString="{0:#,##0}" >
												<ItemStyle HorizontalAlign="Right" Width="14%" />
											</asp:BoundField>
											<asp:BoundField DataField="Rpt" HeaderText="명세서" HtmlEncode="False" >
												<ItemStyle HorizontalAlign="Center" Width="10%" />
												<HeaderStyle Font-Underline="True" />
											</asp:BoundField>
											<asp:BoundField DataField="Url" HeaderText="상세" HtmlEncode="False" >
												<ItemStyle HorizontalAlign="Center" Width="10%" />
												<HeaderStyle Font-Underline="True" />
											</asp:BoundField>
										</Columns>
									</asp:GridView>
								</td>
							</tr>
						</table>
						<!-- 검색어 끝 -->
						<!-- 전체리스트 끝 -->
					</td>
					<td width="1%"></td>
					<td align="right" valign="top" width="40%">
						<!-- 계정별분포도 시작 -->
						<table id="table_chart_pie_detail" class="default" runat="server">
							<tr>
								<td><div class="sub_title_icon"><asp:Literal id="ltr_stitle_account_chart" Text="계정별분포도" runat="server" /></div></td>
							</tr>
							<tr>
								<td class="td_box">
									<chartfx7:Chart ID="chart_pie_detail" runat="server" Palette="DarkPastels.Pastels" Height="460px" ImageSettings-Interactive="False" Width="420px">
										<AxisY Title-Text="">
											<Grids Major-Style="Solid" Interlaced="True"></Grids>
											<LabelsFormat CustomFormat="###,###,##0" />
										</AxisY>

										<AxisX Title-Text="">
										<Grids Major-Visible="False"></Grids>
										</AxisX>

										<AllSeries Gallery="Pie" PointLabels-BackColor="Transparent" PointLabels-Font="Tahoma, 8pt" PointLabels-Visible="True"></AllSeries>

										<LegendBox Dock="Top"></LegendBox>

										<MainPane AxisY-Title-Text=""></MainPane>
										<SpecialObjects>
											<chartfxadornments:SimpleBorder AssemblyName="ChartFX.WebForms.Adornments" Color="Transparent"
												Type="None">
											</chartfxadornments:SimpleBorder>
											<chartfxadornments:GradientBackground AssemblyName="ChartFX.WebForms.Adornments"
												ColorFrom="Transparent" EffectArea="0">
											</chartfxadornments:GradientBackground>
											<chartfx7galleries:Pie ExplodingMode="All" Shadows="True" SliceSeparation="10">
											</chartfx7galleries:Pie>
										</SpecialObjects>										
										<View3D Enabled="True" />
										<Series>
											<chartfx7:SeriesAttributes MarkerStep="3" />
											<chartfx7:SeriesAttributes />
											<chartfx7:SeriesAttributes />
										</Series>
									</chartfx7:Chart>
								</td>
							</tr>
						</table>
						<!-- 계정별분포도 끝 -->
						<br>
						<!-- 계정별리스트 시작 -->
						<table id="table_dg2" cellpadding="0" cellspacing="0" border="0" width="100%" runat="server">
							<tr>
								<td class="sub_title_icon"><asp:label id="lbl_label" runat="server" Font-Bold="True"></asp:label></td>
							</tr>
							<tr>
								<td>
									<asp:GridView ID="GridView2" CssClass="table_gridview" GridLines="None" runat="server" AutoGenerateColumns="False" OnRowDataBound="GridView2_RowDataBound" DataKeyNames="Account_Nm">
										<Columns>
											<asp:BoundField HeaderText="번호" HtmlEncode="False" >
												<ItemStyle HorizontalAlign="Center" Width="8%" />
											</asp:BoundField>
											<asp:BoundField DataField="Account_Nm_Link" HeaderText="계정" HtmlEncode="False" >
												<ItemStyle HorizontalAlign="Left" Width="62%" />
												<HeaderStyle Font-Underline="True" />
											</asp:BoundField>
											<asp:BoundField DataField="Account_Nm" HeaderText="Account_Nm(X)" Visible="False" />
											<asp:BoundField DataField="Total" HeaderText="총액" DataFormatString="{0:#,##0}" HtmlEncode="False" >
												<ItemStyle HorizontalAlign="Right" Width="30%" />
											</asp:BoundField>
										</Columns>										
									</asp:GridView>
								</td>
							</tr>
						</table>
						<!-- 계정별리스트 끝 -->
						<br>
						<!-- 계정별상세리스트 시작 -->
						<table id="table_dg3" cellpadding="0" cellspacing="0" border="0" width="100%" runat="server">
							<tr>
								<td class="sub_title_icon"><asp:label id="lbl_label_detail" runat="server" Font-Bold="True"></asp:label></td>
							</tr>
							<tr>
								<td>
									<asp:GridView ID="GridView3" CssClass="table_gridview" GridLines="None" runat="server" AutoGenerateColumns="False" OnRowDataBound="GridView3_RowDataBound">
										<Columns>
											<asp:BoundField HeaderText="구분" HtmlEncode="False" DataField="Biz_Div_Nm" >
												<ItemStyle HorizontalAlign="Left" />
											</asp:BoundField>
											<asp:BoundField DataField="Account_Nm" HeaderText="계정" HtmlEncode="False" >
												<ItemStyle HorizontalAlign="Center" />
											</asp:BoundField>
											<asp:BoundField DataField="Biz_Dt" HeaderText="카드사용일" HtmlEncode="False" >
												<ItemStyle HorizontalAlign="Center" />
											</asp:BoundField>
											<asp:BoundField DataField="Contents" HeaderText="내용" HtmlEncode="False">
												<HeaderStyle CssClass="balloon" />
												<ItemStyle HorizontalAlign="Left" />
											</asp:BoundField>
											<asp:BoundField DataField="Total" HeaderText="금액" DataFormatString="{0:#,##0}" HtmlEncode="False" >
												<ItemStyle HorizontalAlign="Right" />
											</asp:BoundField>
										</Columns>										
									</asp:GridView>
								</td>
							</tr>
						</table>
						<!-- 계정별상세리스트 끝 -->
					</td>
				</tr>
			</table>
			<!-- 디테일 끝 -->
			<!-- 카피라이트 시작 -->
			<ucCopyright:Copyright id="Copyright" runat="server"></ucCopyright:Copyright>
			<!-- 카피라이트 끝 -->
			<!-- 히든값 시작 -->
			<div id="hdn_data">
			<asp:label id="lbl_pk" runat="server"></asp:label>
			<asp:Label id="lbl_search_flag" runat="server"></asp:Label>
			<input id="h_card_cd" type="hidden" name="h_card_cd" runat="server" />
			<input id="h_paymnt_dt" type="hidden" name="h_paymnt_dt" runat="server" />
			<input id="h_account" type="hidden" name="h_account" runat="server" />
			<input id="h_account_nm" type="hidden" name="h_account_nm" runat="server" />
			<asp:linkbutton id="lbtn_pie_chart" runat="server" OnClick="lbtn_pie_chart_Click"></asp:linkbutton>
			<asp:linkbutton id="lbtn_view_detail" runat="server" OnClick="lbtn_view_detail_Click"></asp:linkbutton>
			</div>
			<!-- 히든값 끝 -->
			</ContentTemplate>
			</asp:UpdatePanel>
			<!-- AJAX 끝 -->
		</td>
	</tr>
</table>

<asp:updateprogress AssociatedUpdatePanelID="UpdatePanel1" ID="updateProgress" runat="server">
	<progresstemplate>
		<div id="progressBackgroundFilter"></div>
		<div id="processMessage">
			<div id="processing"></div>
			<img src="../Common/Images/processing_img.gif" />
		</div>
	</progresstemplate>
</asp:updateprogress>

</form>
<script type="text/javascript" language="javascript" defer="defer">
	//검색
	function chkSearch() {
		var from_dt = $F("ddl_search_from_year") + $F("ddl_search_from_month");
		var to_dt = $F("ddl_search_to_year") + $F("ddl_search_to_month");
					
		if(!isDateSeq(from_dt, to_dt)) {
			msgBox.alert(getMsg(MSG_ERR_022)); //시작일자가 종료일자보다 늦을수 없습니다
			return false;
		}
	}
	
	// 바그래프에서 파이그래프 보기
	function viewPieChart(arg_card_cd, arg_paymnt_dt) {
		$("h_card_cd").value = arg_card_cd;
		$("h_paymnt_dt").value = arg_paymnt_dt;
		
		__doPostBack('lbtn_pie_chart','');
	}

	// 파이그래프에서 상세목록조회
	function viewDetail(arg_card_cd, arg_paymnt_dt, arg_account, arg_account_nm) {
		$("h_card_cd").value = arg_card_cd;
		$("h_paymnt_dt").value = arg_paymnt_dt;
		$("h_account").value = arg_account;
		$("h_account_nm").value = arg_account_nm;
		
		__doPostBack('lbtn_view_detail','');
	}
</script>
</body>
</html>